package com.bjsxt.Lambda;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

class ComparatorImpl implements Comparator<String>{

    @Override
    public int compare(String o1, String o2) {
        return o1.compareTo(o2);
    }
}
public class Test6 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("a");
        list.add("t");
        list.add("c");
        list.add("b");
//        list.sort(new ComparatorImpl());
        list.sort((o1,o2)->o1.compareTo(o2));
        list.forEach(System.out::println);

    }
}
